#include <allegro.h>

#ifndef STAGE1_H_INCLUDED
#define STAGE1_H_INCLUDED
#define GFX_W 800 
#define GFX_H 600
#define NB_IMAGES 4
#define NB_IMAGES_attack 16

struct Sandra {
	BITMAP * img_right[NB_IMAGES];//images sandra right
	BITMAP * img_left[NB_IMAGES];//images sandra left
	BITMAP * jump_right;//images sandra jump right
	BITMAP * jump_left;//images sandra jump left
	BITMAP * stand_right;//image standard
	BITMAP * stand_left; //image standard 
	BITMAP * attack_right[NB_IMAGES_attack];//images attaque
	BITMAP * aiming_right;//sandra epais
	BITMAP * aiming_left;//sandra epais
	int x, y;//coordonné
	int v;//poids
	int d;//mouvement sandra:1 mobile:0
	int cas;// 0:marcher normal , 1:marcher avec attaque du l'arc

	int direction; // 0:right 1:left 2:up
};
typedef struct Sandra Sandra;
struct Scroller//camera
{
int x;
int y;	
} ;
typedef struct Scroller Scroller;
struct Arc
{
	int x,y;//coordonné
	BITMAP * img;//image épais
};
typedef struct Arc Arc;

int get_pixel(BITMAP* Buffer,int x,int y);
// Module Pause
BITMAP* load_background_bmp(char chemin_menu1[]);


//Module Background
BITMAP* load_background_bmp(char chemin_background[]);
BITMAP* load_background1_bmp(char chemin_background_col[]);
void draw_background(BITMAP *Background,BITMAP*Buffer,Scroller scrol);
void destroy_background(BITMAP * Background);
//Module Music 
SAMPLE* load_music(char chemin_music[]);
SAMPLE* load_musicc(char chemin_musicc[]);
void play_music(SAMPLE *music);
void play_musicc(SAMPLE *wolf);
void destroy_music(SAMPLE *music);
//Module Sandra
void load_sandra(Sandra *sandra);
void destroy_sandra(Sandra *sandra);
void init_sandra(Sandra *sandra);//initialisier sandra
//Module Scroller
void init_scroller(Scroller *scrol);//initialiser camera


void move_sandra_right(Sandra *sandra,int *compteur,BITMAP * Background,int pix1,Arc *arc,Scroller *scrol);
void move_sandra_left(Sandra *sandra,int *compteur,BITMAP * Background,int pix2,Scroller *scrol);
void jump_sandra(Sandra *sandra,BITMAP * Background,int pix3,Scroller *scrol); //move up
void stand_sandra(Sandra *sandra,BITMAP * Background,Arc * arc);
void attack_epe(Sandra *sandra,int *compteur,int pix2);
void attack_arc(Sandra *sandra,Arc *arc);

void move_sandra(Sandra *sandra,int *compteur,BITMAP * Background,int pix1,int pix2,int pix3,int pix4,Arc *arc,Scroller *scrol,int *key_down);
void draw_sandra(Sandra sandra,BITMAP *Buffer, int compteur,Arc arc);


int pause_jeux(BITMAP* BackgroundC,BITMAP* BackgroundS,BITMAP* BackgroundO,BITMAP* BackgroundQ,BITMAP* Buffer,int *b,int *c);

//Music

SAMPLE* load_music(char chemin_music[]);
void play_music(SAMPLE *music);
void play_musicc(SAMPLE *wolf);
void destroy_music(SAMPLE *music);






#endif
